var e = require("../../common/vendor.js"), t = {
    onPageScroll: function() {
        this.$refs.dropDown.init();
    },
    computed: {
        dropItem: function(e) {
            var t = this;
            return function(e) {
                var o = {}, l = t.result.find(function(t) {
                    return t.name === e;
                });
                return l ? (o.label = l.label, o.value = l.value) : (o.label = t[e].label, o.value = t[e].value), 
                o;
            };
        },
        currentDropItem: function() {
            return this[this.activeName];
        }
    },
    data: function() {
        return {
            defaultValue: [ 0, "all", "0" ],
            result: [ {
                name: "order",
                label: "最新发布",
                value: "new"
            } ],
            activeName: "order",
            order: {
                label: "综合排序",
                value: "all",
                activeIndex: 0,
                color: "#333",
                activeColor: "#2878ff",
                child: [ {
                    label: "综合排序",
                    value: "all"
                }, {
                    label: "最新发布",
                    value: "new"
                }, {
                    label: "低价优先",
                    value: "money"
                } ]
            },
            type: {
                label: "文档格式",
                value: "all",
                activeIndex: 0,
                color: "#333",
                activeColor: "#2878ff",
                child: [ {
                    label: "全部",
                    value: "all"
                }, {
                    label: "PDF",
                    value: "pdf"
                }, {
                    label: "WROD",
                    value: "word"
                }, {
                    label: "PPT",
                    value: "ppt"
                } ]
            },
            vip_type: {
                label: "VIP文档",
                value: 0,
                activeIndex: 0
            }
        };
    },
    methods: {
        change: function(e) {
            console.log("弹窗打开状态：", e);
        },
        selectMenu: function(e) {
            var t = this, o = e.name, l = (e.active, e.type);
            if (this.activeName = o, 1 == l) this.clickItem({
                name: "vip_type",
                label: "VIP文档",
                value: e.active ? 1 : 0
            }); else {
                var a = this.result.find(function(e) {
                    return e.name == t.activeName;
                });
                if (a) {
                    var n = this[this.activeName].child.findIndex(function(e) {
                        return e.label == a.label && e.value == a.value;
                    });
                    this[this.activeName].activeIndex = n;
                } else this[this.activeName].activeIndex = 0;
            }
        },
        clickItem: function(t) {
            var o = this, l = t.label, a = t.value, n = this.result.findIndex(function(e) {
                return e.name == o.activeName;
            });
            this.defaultValue.indexOf(a) > -1 && this[this.activeName].label && (l = this[this.activeName].label), 
            n > -1 ? this.$set(this.result, n, {
                name: this.activeName,
                label: l,
                value: a
            }) : this.result.push({
                name: this.activeName,
                label: l,
                value: a
            }), this.result = this.result.filter(function(e) {
                return -1 == o.defaultValue.indexOf(e.value);
            }), e.index.showModal({
                content: "筛选的值：".concat(JSON.stringify(this.result))
            });
        }
    }
};

Array || (e.resolveComponent("uv-search") + e.resolveComponent("uv-drop-down-item") + e.resolveComponent("uv-drop-down") + e.resolveComponent("uv-drop-down-popup") + e.resolveComponent("uv-image") + e.resolveComponent("uv-gap"))(), 
Math || (function() {
    return "../../uni_modules/uv-search/components/uv-search/uv-search.js";
} + function() {
    return "../../uni_modules/uv-drop-down/components/uv-drop-down-item/uv-drop-down-item.js";
} + function() {
    return "../../uni_modules/uv-drop-down/components/uv-drop-down/uv-drop-down.js";
} + function() {
    return "../../uni_modules/uv-drop-down/components/uv-drop-down-popup/uv-drop-down-popup.js";
} + function() {
    return "../../uni_modules/uv-image/components/uv-image/uv-image.js";
} + function() {
    return "../../uni_modules/uv-gap/components/uv-gap/uv-gap.js";
})();

var o = e._export_sfc(t, [ [ "render", function(t, o, l, a, n, r) {
    return {
        a: e.o(function(e) {
            return t.keyword = e;
        }),
        b: e.p({
            placeholder: "请输入搜索内容",
            "show-action": !1,
            searchIconColor: "#333333",
            inputAlign: "center",
            color: "#000000",
            placeholderColor: "#333333",
            bgColor: "#3896CC",
            modelValue: t.keyword
        }),
        c: e.p({
            name: "order",
            type: "2",
            label: r.dropItem("order").label,
            value: r.dropItem("order").value
        }),
        d: e.p({
            name: "type",
            type: "2",
            label: r.dropItem("type").label,
            value: r.dropItem("type").value
        }),
        e: e.p({
            name: "vip_type",
            type: "1",
            label: "VIP文档",
            value: r.dropItem("vip_type").value
        }),
        f: e.sr("dropDown", "931b39b0-1"),
        g: e.o(r.selectMenu),
        h: e.p({
            sign: "dropDown_1",
            "text-style": {
                activeColor: "red"
            },
            "extra-icon": {
                name: "arrow-down-fill",
                color: "#666",
                size: "26rpx"
            },
            "extra-active-icon": {
                name: "arrow-up-fill",
                color: "#2878ff",
                size: "26rpx"
            },
            defaultValue: n.defaultValue,
            "custom-style": {
                padding: "0 30rpx"
            }
        }),
        i: e.o(r.clickItem),
        j: e.o(r.change),
        k: e.p({
            sign: "dropDown_1",
            "click-overlay-on-close": !0,
            currentDropItem: r.currentDropItem
        }),
        l: e.p({
            src: "/static/image/bottom.png",
            width: "750rpx",
            mode: "widthFix"
        }),
        m: e.p({
            height: "30"
        })
    };
} ], [ "__scopeId", "data-v-931b39b0" ] ]);

t.__runtimeHooks = 1, wx.createPage(o);